package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.TmcActivityUser;
import com.ruoyi.system.mapper.CompanyMapper;
import com.ruoyi.system.mapper.PayMapper;
import com.ruoyi.system.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class PayServiceImp implements PayService {
    @Autowired
    private PayMapper payMapper;
    @Override
    public String selectOpenId(Long id) {
        return payMapper.selectOpenId(id);
    }

    @Override
    public int insertNum(HashMap<String,Object> map) {
        return payMapper.insertNum(map);
    }

    @Override
    public void updateState(String out_trade_no) {
        payMapper.updateState(out_trade_no);
    }

    @Override
    public TmcActivityUser selectUser(Long id, Long userId) {
        HashMap<String, Long> map = new HashMap<>();
        map.put("id",id);
        map.put("userId",userId);
        return  payMapper.selectUser(map);
    }

    @Override
    public List<TmcActivityUser> selectUsers(Long userId) {
        return payMapper.selectUsers(userId);
    }
}
